import React, { Component } from "react";
import { Switch, Route, Redirect, Link } from "react-router-dom";
import { Menu } from "antd";
import thereportcenterhome from "./home";
import ics from "./ics";
import database from "./database";
import baseline from "./baseline";
import Sitetoscan from "./Sitetoscan";
class thereportcenter extends Component {
  constructor(props) {
    super(props);
    this.state = {
      current: "1",
    };
  }
  handleClick = (e) => {
    console.log("click ", e);
    this.setState({
      current: e.key,
    });
  };
  render() {
    return (
      <div>
        <Menu
          className="nav"
          onClick={this.handleClick}
          selectedKeys={[this.state.current]}
          mode="horizontal"
        >
          <Menu.Item key="1">
            <Link to="/thereportcenter">主机扫描报表</Link>
          </Menu.Item>
          <Menu.Item key="2">
            <Link to="/thereportcenter/ics">工控扫描报表</Link>
          </Menu.Item>
          <Menu.Item key="3">
            <Link to="/thereportcenter/database">数据库扫描报表</Link>
          </Menu.Item>
          <Menu.Item key="4">
            <Link to="/thereportcenter/baseline">基线扫描报表</Link>
          </Menu.Item>
          <Menu.Item key="5">
            <Link to="/thereportcenter/Sitetoscan">网站扫描报表</Link>
          </Menu.Item>
        </Menu>
        <Switch>
          <Route
            path="/thereportcenter"
            component={thereportcenterhome}
            exact
          />
          <Route path="/thereportcenter/ics" component={ics} />
          <Route path="/thereportcenter/database" component={database} />
          <Route path="/thereportcenter/baseline" component={baseline} />
          <Route path="/thereportcenter/Sitetoscan" component={Sitetoscan} />
          <Redirect to="/thereportcenter" />
        </Switch>
      </div>
      // <>123</>
    );
  }
}

export default thereportcenter;
